package com.smz.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.smz.entity.TCargo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TCargoDAO extends BaseMapper<TCargo> {
    TCargo selectByName(@Param("product") String product);

    /**
     * 按货架ID查询货位
     *
     * @param
     * @return
     */
    List<TCargo> selectTCargoByTShelvesId(@Param("shelvesNo") Integer shelvesNo, @Param("wareId") Integer wareId, @Param("dameId") Integer dameId);

    /**
     * @Authoe: smz
     * @Description: 仓库id，货区id，货架id，查询货位
     * @Date: 15:15 2021-11-24
     */
    List<TCargo>selectTCargoByShelvesNo(@Param("shelvesNo") Integer id,@Param("wareId") Integer id2,@Param("dameId") Integer id3);

    /**
     * @Authoe: smz
     * @Description: 仓库id，货区id，货架id，当前页，页面大小分页查询
     * @Date: 15:15 2021-11-24
     */
    IPage<TCargo> selectPageTCargo(Page<TCargo> page, @Param("dameId")String dameId, @Param("wareId")String wareId, @Param("shelvesNo")String shelvesNo);

    /**
     * @Authoe: smz
     * @Description: 页面三个搜索框进行条件搜索
     * @Date: 15:16 2021-11-24
     */
    IPage<TCargo> selectTCargoByWareId(Page<TCargo> page,@Param("wareId")String wareId,@Param("pNumber") String pNumber,@Param("pName")String pName);


    /**
     * @Authoe: smz
     * @Description: 根据仓库，库区，货架，货位查询是否存在商品
     * @Date: 10:29 2021-11-30
     */
    TCargo findTCargoByMenuIdAndMore(@Param("menuId")String menuId,@Param("reservoirId")String reservoirId,@Param("ShelvesId")String shelvesId,@Param("cargoId")String cargoId);

}
